package com.tcenter.dao.entities;


import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 */
@Embeddable
public class StudentTaskId implements java.io.Serializable {

    private int studentId;
    private int taskId;


    public StudentTaskId() {
    }

    public StudentTaskId(int studentId, int taskId) {
        this.studentId = studentId;
        this.taskId = taskId;
    }


    @Column(name = "student_id", nullable = false)
    public int getStudentId() {
        return this.studentId;
    }

    public void setStudentId(int studentId) {
        this.studentId = studentId;
    }

    @Column(name = "task_id", nullable = false)
    public int getTaskId() {
        return this.taskId;
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }


    public boolean equals(Object other) {
        if ((this == other))
            return true;
        if ((other == null))
            return false;
        if (!(other instanceof StudentTaskId))
            return false;
        StudentTaskId castOther = (StudentTaskId) other;

        return (this.getStudentId() == castOther.getStudentId())
                && (this.getTaskId() == castOther.getTaskId());
    }

    public int hashCode() {
        int result = 17;

        result = 37 * result + this.getStudentId();
        result = 37 * result + this.getTaskId();
        return result;
    }

}
